import request from '@/utils/request'

// 获取用户数据
export const getUserData = () => request.get('/user')

// 获取收藏列表
export const getFavorites = () => request.get('/user/favorites')

// 获取已发布房源
export const getHouses = () => request.get('/user/houses')

// 获取首页轮播图信息
export const getSwiper = () => request.get('/home/swiper')

// 获取热门城市数据
export const getHotCity = () => request.get('/area/hot')

// 获取所有城市数据
export const getAllCity = () => request.get('/area/city', {
  params: {
    level: 1
  }
})

// 根据城市名称查询城市信息
export const getCityData = (data) => request.get('/area/info', {
  params: {
    ...data
  }
})

// 根据关键词查询小区
export const getCommunity = (data) => request.get('/area/community', {
  params: {
    ...data
  }
})

// 获取子级城市
export const getSubLevelCity = (data) => request.get('/area', {
  params: {
    ...data
  }
})

// 获取房屋查询条件
export const getConditionHouse = (data) => request.get('/houses/condition', {
  params: {
    ...data
  }
})

// 根据条件查询房屋
export const getEnquiryHousing = (data) => request.get('/houses', {
  params: {
    ...data
  }
})

// 查询房源数据(地图使用)
export const getMapHousing = (data) => request.get('/area/map', {
  params: {
    ...data
  }
})
